package edu.zut.dao;

import edu.zut.util.DBUtils;

import java.sql.ResultSet;
import java.sql.SQLException;

//和用户相关的数据层（操作数据库）
public class UserDao {

    //根据账号和密码查询是否正确的操作
    public boolean loginQuery(String account, String psw) {
        String sql = "select * from sys_user where user_name=? and user_password = ?";
        ResultSet rs = DBUtils.query(sql, account, psw);
        boolean flag = false;
        try {
            if (rs.next()){
                flag = true;
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return flag;
    }

}
